<html>
<head><meta charset="utf-8"><title>strange issue when building with  master toolchain · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html">strange issue when building with  master toolchain</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216732329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732329">(Nov 14 2020 at 14:39)</a>:</h4>
<p>So, previously I could update my master toolchain, build clippy with it, cp the binaries into <code>~/.rustup/toolchains/master/bin</code> and I could run clippy-driver $file, but that no longer seems to work due to<br>
<code>/home/matthias/.rustup/toolchains/master/bin/clippy-driver: error while loading shared libraries: librustc_driver-7d9e6eca764b498c.so: cannot open shared object file: No such file or directory</code><br>
I have no idea what causes this since the clippy that comes with the master toolchain just works :|</p>



<a name="216732404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732404">(Nov 14 2020 at 14:41)</a>:</h4>
<p>did anything about the sysroot change recently?</p>



<a name="216732519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732519">(Nov 14 2020 at 14:42)</a>:</h4>
<p>That worked for you the whole time? <span aria-label="open mouth" class="emoji emoji-1f62e" role="img" title="open mouth">:open_mouth:</span>  I always have to set <code>LD_LIBRARY_PATH</code> beforehand. Try setting <code>export LD_LIBRARY_PATH=$(rustc +master --print sysroot)/lib</code> before using the master clippy with <code>cargo +master clippy</code>.</p>
<p>This is also what we do in CI for quite some time now.</p>



<a name="216732606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732606">(Nov 14 2020 at 14:44)</a>:</h4>
<p>hmm</p>



<a name="216732656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732656">(Nov 14 2020 at 14:45)</a>:</h4>
<p>maybe we need a "install into master toolchain" <code>cargo dev</code> command.. :)</p>



<a name="216732686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732686">(Nov 14 2020 at 14:45)</a>:</h4>
<p>This is because Clippy tries to find the sysroot with your default <code>rustc</code>. Which we can't really change, since we can't assume the toolchain in use when running Clippy. If Clippy is compiled and shipped with rustc. this gets backed into Clippy and it works. At least that's how I understood the hacky clippy-driver code, last time I dealt with it.</p>



<a name="216732736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732736">(Nov 14 2020 at 14:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="217864">matthiaskrgr</span> <a href="#narrow/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain/near/216732656">said</a>:</p>
<blockquote>
<p>maybe we need a "install into master toolchain" <code>cargo dev</code> command.. :)</p>
</blockquote>
<p>Why not :)</p>



<a name="216732764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732764">(Nov 14 2020 at 14:46)</a>:</h4>
<p>Hmm, found this in my <code>.zshrc</code> <code>LD_LIBRARY_PATH=$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/</code> <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="216732868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732868">(Nov 14 2020 at 14:48)</a>:</h4>
<p>You can change it to <code>LD_LIBRARY_PATH=$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/:$HOME/.rustup/toolchains/master/lib/</code> and it should Just Work in the future</p>



<a name="216732995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216732995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216732995">(Nov 14 2020 at 14:50)</a>:</h4>
<p>oh that's genius :D</p>



<a name="216734705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/strange%20issue%20when%20building%20with%20%20master%20toolchain/near/216734705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain.html#216734705">(Nov 14 2020 at 15:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="264664">flip1995</span> <a href="#narrow/stream/257328-clippy/topic/strange.20issue.20when.20building.20with.20.20master.20toolchain/near/216732686">said</a>:</p>
<blockquote>
<p>This is because Clippy tries to find the sysroot with your default <code>rustc</code>. Which we can't really change, since we can't assume the toolchain in use when running Clippy. If Clippy is compiled and shipped with rustc. this gets backed into Clippy and it works. At least that's how I understood the hacky clippy-driver code, last time I dealt with it.</p>
</blockquote>
<p><span class="user-mention" data-user-id="264664">@flip1995</span>  I'd love to hear your opinions on <a href="https://github.com/rust-lang/rust/pull/78926">https://github.com/rust-lang/rust/pull/78926</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>